﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace GalaxyPresident
{
    class CreateMotherShipTask : Task
    {
        AirPort airPort;
        MotherShip motherShip;
        public CreateMotherShipTask(AirPort airPort)
        {
            this.airPort = airPort;
            //motherShip = new MotherShip(airPort.PlanetOwner);
        }
        public CreateMotherShipTask(AirPort airPort, string resString, Color color)
        {
            this.airPort = airPort;
            //motherShip = new MotherShip(airPort.PlanetOwner);
            CreateButton(resString, color);

        }
        public override bool Execute()
        {
            motherShip = new MotherShip(airPort.PlanetOwner);
            motherShip.updatePlanetOwnerResources();
            //motherShip = (MotherShip)airPort.createUnit(3);
            airPort.PlanetOwner.TeamOwner.MotherShips.Add(motherShip);
            return true;
        }

        public override void UpdateInfo(GameTime gameTime)
        {
            button.IsEnable = airPort.isEnoughResourcesForProduce(3);
        }
    }
}
